<template>
  <div class="customer-info" :style="{maxHeight:$height- 305 + 'px'}">
    <h1>公司信息</h1>
    <div class="info">
      <img v-if="company.logoUrl" :src="company.logoUrl" alt="">
      <b class="default-img" v-else >{{company.fullname.slice(0,1)}}</b>
      <span class="more">{{company.fullname}}</span>
    </div>
    <h1>联系人</h1>
    <ul class="list">
      <li v-for="item,index in company.custLinkDtos">
        <h2 class="more">{{item.linker}}</h2>
        <p>职位：{{item.postType?item.postType:'-'}}</p>
        <p class="more">邮箱：{{item.email}}</p>
        <p>电话：{{item.telFax?item.telFax:'-'}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
    import { getCompanyInfo} from "@/api/mail/make"
    export default {
        name: "CustomerInfo",
        data(){
            return{
                company:{
                    custLinkDtos:[],
                    fullname:''
                }
            }
        },
        methods:{
            getCompany(info){
                getCompanyInfo(info.email).then(res=>{
                    if(res.data.success){
                        this.company=res.data.data;
                        console.log(this.company)
                    }
                })
            }
        }
    }
</script>

<style scoped lang="scss">
  .customer-info {
    overflow-y: auto;
    h1{
      font-size: 15px;
      color: #000;
      margin-bottom: 10px;
      font-weight: 600;
    }
    .info{
      display: flex;
      align-items: center;
      padding-bottom: 20px;
      margin-bottom: 10px;
      border-bottom: 1px solid #F3F3F3;
      .default-img{
        display: inline-block;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        border-radius: 50%;
        background:#325893;
        color: white;
      }
      img{
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 1px solid #2A97F9;
      }
      span{
        color: #000;
        font-size: 14px;
        margin-left: 16px;
      }
    }
    .list{
      li{
        border: 1px solid #E9F3FD;
        background-color: #E9F3FD;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 15px;
        h2{
          font-size: 15px;
          color: #2A97F9;
          font-weight: normal;

        }
        p{
          line-height: 25px;
          font-size: 14px
        }
      }
    }
  }
</style>
